<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="http://img.mukewang.com/down/540812440001e40e00000000.js" type="text/javascript"></script>
    <style type="text/css">
    div {
        width: 30px;
        height: 10px;
        float: left;
    }
    </style>
    <title>无标题文档</title>
</head>

<body>
    <button id="test1">jQuey[0]</button>
    <button id="test2">jQuey.get</button>
    <button id="test3">aQuery[0]</button>
    <button id="test4">aQuery.get</button>
    <p id="book">book</p>
    <div id="show1"></div>
    <div id="show2"></div>
    <div id="show3"></div>
    <div id="show4"></div>
    <script type="text/javascript">
    var aQuery = function(selector) {
        //强制为对象
        if (!(this instanceof aQuery)) {
            return new aQuery(selector);
        }
        var elem = document.getElementById(/[^#].*/.exec(selector)[0]);
        this.length = 1;
        this[0] = elem;
        this.context = document;
        this.selector = selector;
        this.get = function(num) {
            return this[num];
        }
        return this;
    }


    function ajQuery() {
        this.name = 'jQuery';
        this.sayName = function() {
            return this.name
        }
    }
    var a = new ajQuery();
    var b = new ajQuery();
    var c = new ajQuery();
    </script>
</body>

</html>